{include file="header" /}
<div class="fly-msg" style="margin-bottom: 20px;">消费记录 </div>
<div class="layui-row layui-col-space20">
    <div class="layui-col-md12">
        <div class="fly-home fly-panel" style="text-align: left">
            <form class="layui-form layui-form-pane" action="javascript:;" method="post">
                <div class="layui-form-item">

                    <div class="layui-inline">
                        <label class="layui-form-label">订单时间:</label>
                        <div class="layui-input-inline" style="width: 100px;">
                            <input type="text"  name="start_addtime" id="start_addtime" placeholder="" autocomplete="off" class="layui-input">
                        </div>
                        <div class="layui-form-mid">-</div>
                        <div class="layui-input-inline" style="width: 100px;">
                            <input type="text" name="end_addtime" id="end_addtime" placeholder="" autocomplete="off" class="layui-input">
                        </div>
                    </div>

                    <div class="layui-inline">

                        <div class="layui-input-inline" style="width: 100px;">

                            <select name="type" class="layui-input layui-unselect">
                                <option value="">消费类型</option>
                                <option value="1">金钱</option>
                                <option value="2">积分</option>
                            </select>
                        </div>
                    </div>  <div class="layui-inline">

                    <div class="layui-input-inline" style="width: 100px;">

                        <input class="layui-btn" lay-submit lay-filter="formDemo" type="button" value="搜索" id="search">
                    </div>
                </div>

                </div>
            </form>
            <table class="layui-hide" id="test"></table>

        </div>

    </div>

</div>
{include file="footer" /}
<script>
    layui.use(['form', 'layer', 'jquery','table','laydate'], function(){
        var table = layui.table
        ,form = layui.form,
            layer = layui.layer,
            laydate = layui.laydate,
            $ = layui.jquery;
        laydate.render({
            elem: '#start_addtime'
            ,value: '{:date("Y-m-d",time())}'
            ,showBottom: false
        });
        laydate.render({
            elem: '#end_addtime'
            ,value: '{:date("Y-m-d",strtotime(" + 1day"))}'
            ,showBottom: false
        });
        //监听提交
        form.on('submit(formDemo)', function(data){
            var datas= data.field;

     /*       if(datas.type==''){
                layer.msg('消费类型不能为空')
                return false;
            }*/

                table.render({
                    elem: '#test'
                    ,url:'{:url("OnlineRecharge/expenses_record")}'
                    ,method:'POST'
                    ,where:datas
                    ,cols: [[
                        {field:'serial_number', title: '流水号', sort: true}
                        ,{field:'username', title: '消费内容', sort: true}
                        ,{field:'creat_at',  title: '时间', sort: true}
                        ,{field:'type', title: '消费类型', sort: true}
                        ,{field:'value',  title: '数量', sort: true}



                    ]]
                    ,page: true
                });

            return false;
        });
        table.render({
            elem: '#test'
            ,url:'{:url("OnlineRecharge/expenses_record")}'
            ,method:'POST'
            ,data:[]
            ,cols: [[
                {field:'serial_number', title: '流水号', sort: true}
                ,{field:'username', title: '消费内容', sort: true}
                ,{field:'creat_at',  title: '时间', sort: true}
                ,{field:'type', title: '消费类型', sort: true}
                ,{field:'value',  title: '数量', sort: true}



            ]]
            ,page: true
        });


    });

</script>
